<style>
.error{
    color:#f00;
}


div#loginDIV
{
position: absolute;
width: 500px;
height: 180px;
background-color:white;
z-index: 20;
}
div#loginTopDIV
{
width: 100%;
height: 22px;
font-size:18px;
text-align:center;
background-color: #FF6A9C;
cursor: move;
}

</style>
    <script type="text/javascript" src="js/jquery/jquery-1.8.0.min.js"></script>
    <script>
        $(function(){
            $.each($('.addposter'),function(){
                $(this).attr('readOnly',true);
                $(this).on('focus',function(){
                $('#postertype').val($(this).attr('id'));
                openDIV();
            });
            });
        })
        function posterAdd(obj) 
        {
            $('#'+$('#postertype').val()).val($(obj).html());   
            closeDIV() 
        }
    </script>
<div class="form" style="border:1px solid #c00;text-align:center;background:#ccc">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'article-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note"><font color=red>带有<span class="required">*</span>的为必填项</font></p>


	<div class="row">
		<?php echo $form->labelEx($model,'标题：'); ?>
		<?php echo $form->textField($model,'Title',array('size'=>20,'maxlength'=>64)); ?>
		<span class='error'><?php echo $form->error($model,'Title'); ?></span>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'内容：'); ?>
		<?php echo $form->textArea($model,'Content',array('rows'=>6, 'cols'=>50)); ?>
		<span class='error'><?php echo $form->error($model,'Content'); ?></span>
	</div>

    <div class="row">
        <?php echo $form->labelEx($model,'文章内广告：'); ?>
        <?php echo $form->textField($model,'ContentPoster',array('class'=>'addposter'));?>
	</div>
	<div class="row">
         <?php echo $form->labelEx($model,'左侧广告：'); ?>
        <?php echo $form->textField($model,'LeftPoster',array('class'=>'addposter'));?>
	</div>

	<div class="row">
         <?php echo $form->labelEx($model,'右侧广告：'); ?>
        <?php echo $form->textField($model,'RightPoster',array('class'=>'addposter'));?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'关键词：'); ?>
		<?php echo $form->textField($model,'KeyWord',array('size'=>60,'maxlength'=>64)); ?>
		<span class='error'> <?php echo $form->error($model,'KeyWord'); ?></span>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '创建' : '保存'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->
<script src="js/DIVDialog.js" defer="defer"></script>
<div id="loginDIV" style="display: none; left: 100px; top: 200px">
<div id="loginTopDIV">请选择广告<span onclick="closeDIV()" style='cursor: pointer;position:absolute;width:20px;height:20px;right:2px'>X</span></div>
<input type='text' hidden='true' id='postertype'>
<table cellspacing="0" cellpadding="0" width="100%" border="0">
    <tr>
          <td align="center" colspan="2"><a href='#' onclick="posterAdd(this)">1</a><br/><a href='#' onclick="posterAdd(this)">2</a></td>
     </tr>
     <tr>
            <td align="center"><?php
//ol列表
  $this->widget('zii.widgets.jui.CJuiSelectable', array(
      'items'=>array(
          'id1'=>'Item 1',
          'id2'=>'Item 2',
          'id3'=>'Item 3',
      ),
      // additional javascript options for the selectable plugin
      'options'=>array(
          'delay'=>'300',
      ),
  ));
//ul列表
  $this->widget('zii.widgets.jui.CJuiSortable', array(
      'items'=>array(
          'id1'=>'Item 1',
          'id2'=>'Item 2',
          'id3'=>'Item 3',
      ),
      // additional javascript options for the accordion plugin
      'options'=>array(
          'delay'=>'300',
      ),
  ));




?></td>
        </tr>
    </table>
</div>
